<!doctype html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>

    <!--  Зависимости Bootstrap-->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
            integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"
            integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V"
            crossorigin="anonymous"></script>

    <title>Шапка</title>
</head>
<body>
<div th:fragment="header">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">Job4jDreamJob</a>
            <div class="collapse navbar-collapse">
                <div class="navbar-nav me-auto">
                    <a class="nav-item nav-link" href="/">Главная</a>
                    <a class="nav-item nav-link active" th:href="@{/vacancies}">Вакансии</a>
                    <a class="nav-item nav-link active" th:href="@{/candidates}">Кандидаты</a>
                    <a class="nav-item nav-link active" th:href="@{/vacancies/create}">Создать вакансию</a>
                    <a class="nav-item nav-link active" th:href="@{/candidates/create}">Создать резюме</a>
                </div>
                <div class="d-flex" th:if="${user.name == 'Гость'}">
                    <a class="nav-link text-secondary me-3" th:href="@{/users/register}">Регистрация</a>
                    <a class="nav-link text-secondary" th:href="@{/users/login}">Войти</a>
                </div>
                <div class="d-flex" th:if="${user.name != 'Гость'}">
                    <a class="nav-link text-secondary me-3" href="#" th:text="${user.name}"></a>
                    <a class="nav-link text-secondary" th:href="@{/users/logout}">Выйти</a>
                </div>
            </div>
        </div>
    </nav>
</div>
</body>
</html>